<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/inventory/RawMaterialInventory.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/inventory/RawMaterialInventory.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '原材料库存',
                name: 'inventory/RawMaterialInventory',
                url: "/RawMaterialInventory/",
                sortName: "id"
            });
            const editFormFields = ref({"Name":"","Barcode":"","Types":"","Earlywarning":"","Price":"","Createtime":"","Inventorynumber":""});
            const editFormOptions = ref([[{"title":"名称","field":"Name","type":"text"}],
                              [{"title":"条码","field":"Barcode","type":"text"}],
                              [{"title":"所属分类","field":"Types","type":"text"}],
                              [{"title":"预警最小数量","field":"Earlywarning","type":"number"}],
                              [{"title":"单价","field":"Price","type":"decimal"}],
                              [{"title":"创建时间","field":"Createtime","type":"date"}],
                              [{"title":"库存数量","field":"Inventorynumber","type":"number"}]]);
            const searchFormFields = ref({});
            const searchFormOptions = ref([]);
            const columns = ref([{field:'Inventorynumber',title:'库存数量',type:'int',width:120,align:'left',sort:true},
                       {field:'Createtime',title:'创建时间',type:'date',width:120,align:'left',sort:true},
                       {field:'Price',title:'单价',type:'decimal',width:120,align:'left'},
                       {field:'Earlywarning',title:'预警最小数量',type:'int',width:120,align:'left'},
                       {field:'Types',title:'所属分类',type:'string',width:120,align:'left'},
                       {field:'Barcode',title:'条码',type:'string',width:120,align:'left'},
                       {field:'Name',title:'名称',type:'string',width:120,align:'left'},
                       {field:'id',title:'id',type:'int',sort:true,width:120,hidden:true,readonly:true,require:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
